<template>
  <div class="user">
    <div class="bg-image">
      <div class="container-top">
        <div class="header">
          <img src="@/assets/images/user/设置.png" alt="" @click="goPersonal" />
          <img src="@/assets/images/user/消息.png" alt="" @click="goMessage" />
        </div>
        <div class="avatar" @click="goUserInfo">
          <img src="@/assets/images/user/avatar.png" alt="" />
          <div class="text">
            <p>yujia1130</p>
            <div class="badge"><span>V1青铜会员</span></div>
          </div>
          <div class="arrow">
            <img src="@/assets/images/user/arrow.png" alt="" />
          </div>
        </div>
        <div class="member" @click="goMember">
          <div class="member-left">
            <p>会员中心</p>
          </div>
          <div class="member-right">
            <p>会员中心</p>
            <p>50元通券天天送</p>
            <img src="@/assets/images/user/红包.png" alt="" />
          </div>
        </div>
      </div>
    </div>

    <div class="order">
      <div class="header">
        <div class="left">
          <p>我的订单</p>
        </div>
        <div class="right">
          <p @click="goOrder">全部</p>
        </div>
      </div>
      <div class="bottom">
        <div class="container">
          <div>
            <img
              class="img1"
              src="@/assets/images/user/未消费.png"
              alt=""
              @click="goOrderSub(0)"
            />
          </div>
          <div>
            <img
              class="img2"
              src="@/assets/images/user/待付款.png"
              alt=""
              @click="goOrderSub(1)"
            />
          </div>
          <div>
            <img
              class="img3"
              src="@/assets/images/user/待评价.png"
              alt=""
              @click="goOrderSub(2)"
            />
          </div>
          <div>
            <img
              class="img4"
              src="@/assets/images/user/退款.png"
              alt=""
              @click="goOrderSub(3)"
            />
          </div>

          <span>未消费</span>
          <span>待付款</span>
          <span>待评价</span>
          <span>已退款</span>
        </div>
      </div>
    </div>

    <div class="card">
      <div class="text" @click="goCard">影视会员卡</div>
      <div class="text" @click="goCoupon">优惠券</div>
      <div class="text">我的收藏</div>
      <div class="text">帮助与反馈</div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {}
  },
  computed: {},
  created() {},
  mounted() {},
  methods: {
    goCoupon() {
      this.$router.push({ name: 'coupon' })
    },
    goCard() {
      this.$router.push({ name: 'card' })
    },
    goOrder() {
      this.$router.push({ name: 'order', params: { id: 0 } })
    },
    goOrderSub(index) {
      this.$router.push({ name: 'order', params: { id: index } })
    },
    goPersonal() {
      this.$router.push({ name: 'personal' })
    },
    goUserInfo() {

      this.$router.push('/user/userInfo')
      console.log(this.$router);
      console.log(123123);
      console.log(12312321312);
    },
    goMessage() {
      this.$router.push({ name: 'message' })
    },
    goMember() {
      this.$router.push({ name: 'member' })
    },
  },
}
</script>

<style scoped lang="scss">
.user {
  width: 750px;
  height: calc(100vh - 166px);
  overflow: auto;
  background-size: 750px 392px;
  background-image: url('~@/assets/images/user/bg2.png');
  background-repeat: no-repeat;
  background-attachment: local;

  .bg-image {
    &::after {
      content: '';
      opacity: 1;
      top: 0;
      left: 0;
      bottom: 0;
      right: 0;
      position: absolute;
      z-index: -1;
    }
  }

  .container-top {
    width: 672px;
    margin: 0 auto;

    .header {
      display: flex;
      justify-content: flex-end;
      height: 40px;
      margin-top: 40px;

      img {
        margin-left: 23px;
        width: 40px;
        height: 40px;
      }
    }

    .avatar {
      display: flex;
      height: 146px;
      margin-top: 45px;

      img {
        height: 146px;
        width: 146px;
      }

      .text {
        width: 672px - 146px;
        margin-left: 32px;

        p {
          color: #ffffff;
          font-size: 36px;
          margin-top: 15px;
        }

        .badge {
          position: relative;
          width: 198px;
          height: 46px;
          opacity: 0.73;
          margin-top: 20px;
          text-align: center;
          line-height: 46px;
          background: #33363d;
          color: #ffffff;
          font-size: 28px;
          border-radius: 10px;
          border-radius: 10px;

          span {
            margin-left: -20px;
          }

          &::after {
            content: '';
            position: absolute;
            width: 16px;
            height: 28px;
            top: 8px;
            right: 10px;
            background: url('~@/assets/images/user/arrow.png');
            background-size: 16px 28px;
          }
        }
      }

      .arrow {
        display: flex;
        align-items: center;
        justify-content: space-evenly;
        width: 24px;
        line-height: 146px;

        img {
          width: 16px;
          height: 28px;
        }
      }
    }

    .member {
      display: flex;
      align-items: center;
      height: 132px;
      margin-top: 34px;
      background: #33363d;
      box-shadow: 0 0 8px 6px rgba(0, 0, 0, 0.1);
      border-radius: 34px;
      border-radius: 34px;

      .member-left {
        display: flex;
        width: 237px;
        height: 94px;
        align-items: center;
        border-right: 2px solid #979797;

        p {
          margin-left: 72px;
          font-size: 36px;
          color: #ffffff;
        }
      }

      .member-right {
        position: relative;
        width: 433px;
        height: 100%;

        p {
          width: 100%;
          opacity: 0.93;
          margin-left: 33px;
          margin-top: 25px;
          font-size: 28px;
          color: #ffffff;
        }

        img {
          position: absolute;
          height: 60px;
          width: 60px;
          right: 44px;
          bottom: 39px;
        }
      }
    }
  }

  .order {
    height: 254px;
    width: 730px;
    margin-top: 45px;
    padding: 10px;
    background: #33363d;
    border-radius: 12px;
    border-radius: 12px;

    .header {
      display: flex;
      height: 25%;
      width: 100%;
      line-height: 70px;

      .left {
        width: 80%;

        p {
          margin-left: 32px;
          font-size: 36px;
          color: #ffffff;
        }
      }

      .right {
        position: relative;
        width: 20%;
        p {
          opacity: 0.61;
          font-size: 28px;
          color: #ffffff;
        }
        &::after {
          content: '';
          position: absolute;
          width: 16px;
          height: 28px;
          top: 50%;
          bottom: 0;
          margin-top: -14px;
          right: 56px;
          background: url('~@/assets/images/user/arrow.png');
          background-size: 16px 28px;
        }
      }
    }

    .bottom {
      width: 100%;
      height: 75%;

      .container {
        width: 90%;
        height: 75%;
        display: flex;
        margin: 0 auto;
        justify-content: space-around;
        align-items: center;
        flex-wrap: wrap;

        div {
          flex-basis: 25%;
          display: flex;
          justify-content: center;
          margin-top: 20px;
        }
        .img1 {
          width: 48px;
          height: 48px;
        }

        .img2 {
          width: 36px;
          height: 43px;
        }

        .img3 {
          width: 45px;
          height: 46px;
        }

        .img4 {
          width: 37px;
          height: 45px;
        }

        span {
          opacity: 0.93;
          font-size: 28px;
          color: #ffffff;
        }
      }
    }
  }

  .card {
    height: 370px;
    width: 670px;
    margin-top: 45px;
    background: #33363d;
    border-radius: 12px;
    border-radius: 12px;
    padding: 28px 33px 45px 42px;
    overflow: hidden;

    .text {
      position: relative;
      width: 750px - 75px;
      height: 45px;
      font-size: 32px;
      color: #ffffff;
      margin-top: 60px;
      line-height: 45px;

      &::after {
        content: '';
        position: absolute;
        width: 16px;
        height: 28px;
        top: 50%;
        bottom: 0;
        margin-top: -14px;
        right: 17px;
        background: url('~@/assets/images/user/arrow.png');
        background-size: 16px 28px;
      }

      &:first-child {
        margin-top: 0;
      }
    }
  }
}
</style>
